{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "443e241a-fd9d-4893-8381-a86475d2e61e",
   "metadata": {},
   "source": [
    "seaborn 提供了 relplot (figure-level 函数) 和两个 axes-level 函数\n",
    "（ scatterplot 和 lineplot ）来绘制相关关系图"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7d61877b-f6ea-451d-b897-2a96089b0f49",
   "metadata": {},
   "source": [
    "下面我将详细介绍 seaborn 中三个相关关系图（Relational plots）绘制\n",
    "函数的使用场景，包括 relplot , scatterplot , 和 lineplot 。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f89b1f00-1b9c-4865-afcb-b63121f862b0",
   "metadata": {},
   "source": [
    "【1】"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "eb4267d4-15fe-4276-a718-8487f135446d",
   "metadata": {},
   "source": [
    "relplot 是一个 figure-level 函数，用于绘制相关关系图。它通过 kind 参数\n",
    "可以绘制散点图或折线图。 relplot 的特点是可以很方便地进行图表的布局\r\n",
    "多个子图的创建。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ac0698a3-6a5c-495d-bbe0-bc5e130a7e8b",
   "metadata": {},
   "source": [
    "relplot 的使用场景"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "986bd0b5-3586-4f0c-a6ec-2aa1d746988c",
   "metadata": {},
   "source": [
    "1. 数据探索和初步分析"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b6e0101b-957d-4a6d-ba18-4b0bc21dbdea",
   "metadata": {},
   "source": [
    "2. 多图布局"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "352a5254-a4df-40c3-9d97-660e9b20cb9f",
   "metadata": {},
   "source": [
    "3. 复杂的可视化需求"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9aa01a4e-295d-4c07-8be6-43213ce20a11",
   "metadata": {},
   "source": [
    "【2】"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "62aa3154-8e7a-46df-a156-8bddc729b99e",
   "metadata": {},
   "source": [
    "scatterplot 是一个 axes-level 函数，专用于绘制散点图。它能够显示两个数\n",
    "值变量之间的关系，并可以通过颜色（ hue ）、样式（ style ）和大\r\n",
    "（ size ）等参数来区分数据点。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7726e6a8-3b2e-469a-8820-e26d0d08624a",
   "metadata": {},
   "source": [
    "scatterplot 的使用场景"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "677365c9-ac46-4e18-a661-697195916ecc",
   "metadata": {},
   "source": [
    "1. 展示两个数值变量之间的关系"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "26d0eb5b-63d2-446c-901c-bd06b68e424e",
   "metadata": {},
   "source": [
    "2. 识别模式和异常值"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f2ef4950-be0d-4549-bbe0-99250740d661",
   "metadata": {},
   "source": [
    "3. 多维数据展示"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "714e76cb-bf49-476c-afb6-cfed8ba50510",
   "metadata": {},
   "source": [
    "4. 分类变量的影响"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "928f095b-98f6-42c1-9296-29e53404b312",
   "metadata": {},
   "source": [
    "【3】"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6dcd6b6e-728b-4f7a-992b-20c7cfb87427",
   "metadata": {},
   "source": [
    "lineplot 是一个 axes-level 函数，专用于绘制折线图。它能够显示连续变量之\n",
    "间的关系或时间序列数据的趋势，并可以通过颜色（ hue ）、样式（ style ）\r\n",
    "大小（ size ）等参数来区分数据线"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f5210ec5-1294-44e1-aaf0-b2393e3ae3e4",
   "metadata": {},
   "source": [
    "lineplot 的使用场景"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f3740f8e-065c-413c-a9cb-fb2091a6ada5",
   "metadata": {},
   "source": [
    "1. 时间序列数据"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "84e88a4b-e38d-4323-a763-8829cb06f99b",
   "metadata": {},
   "source": [
    "2. 连续变量间的关系"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5adfe909-1cb8-49d4-ba4d-8aa1389b752a",
   "metadata": {},
   "source": [
    "3. 多个系列的比较"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f4a45d27-72c1-4b10-82de-bce5a6c89ca8",
   "metadata": {},
   "source": [
    "4. 误差和置信区间"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c4493e7b-59fe-4c38-ade4-335276377e55",
   "metadata": {},
   "source": [
    "【4】"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7c1a8b71-f937-492c-86ea-953de3bebd24",
   "metadata": {},
   "source": [
    "relplot: 适用于数据探索、多图布局和复杂的可视化需求，通过 kind 参数\r\n",
    "可以绘制散点图和折线图。\r\n",
    "scatterplot: 专用于展示两个数值变量之间的关系，适合识别模式、异常值\r\n",
    "和展示多维数据之间的关系。\r\n",
    "lineplot: 专用于展示连续变量之间的关系或时间序列数据的趋势，适合展\r\n",
    "示多个系列的比较和误差范围。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e995fbd3-7c90-4104-8914-79b739e1a9d4",
   "metadata": {},
   "source": [
    "relplot: 提供了一个高层次的接口，用于绘制相关关系图，能够通过 kind\n",
    "参数指定具体的图表类型（散点图或折线图）。\n",
    "scatterplot: 专用于绘制散点图，适合展示两个数值变量之间的关系，还可\n",
    "以通过颜色、样式和大小进一步细分数据点。\n",
    "lineplot: 专用于绘制折线图，适合展示连续变量之间的关系或时间序列数\n",
    "据的趋势，同样支持通过颜色、样式和大小细分数据线"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
